<?php
class EwhErrorCode {
    //convention [modulecode 3 characters][error code 3 digits]
    //import
    const IMP_CREAT_IMTICKET_FAIL = "PHA_001";
    const IMP_SAVE_IMTICKET_FAIL = "PHA_002";
    const IMP_DUPLICATE_DRUG_MATERIAL_NAME = "PHA_003";
    const IMP_ADD_DRUG_MATERIAL_FAIL = "PHA_004";
    const IMP_DRUG_MATERIAL_NOT_EXIST = "PHA_005";
    const IMP_DRUG_MATERIAL_WRONG_TYPE = "PHA_006";
    const IMP_IMTICKET_NOT_FOUND = "PHA_007";

    const EXP_CREAT_EXTICKET_FAIL = "PHA_008";
    const EXP_EXTICKET_NOT_EXIST = "PHA_009";
    const EXP_REJECT_EXTICKET_FAIL = "PHA_010";
    
    const EVP_COULT_NOT_FINALIZE_IMTICKET = "PHA_011";


    public static function getErrorMess($errCode, $input1=null,$input2=null,$input3=null,$input4 = null) {
        switch ($errCode) {
            case EwhErrorCode::IMP_CREAT_IMTICKET_FAIL:
                return L10nHelper::_("Creating import ticket failed");
            case EwhErrorCode::IMP_SAVE_IMTICKET_FAIL:
                return L10nHelper::_("Saving import ticket failed");
            case EwhErrorCode::IMP_DUPLICATE_DRUG_MATERIAL_NAME:
                return L10nHelper::_("Duplicate drug/material name");
            case EwhErrorCode::IMP_ADD_DRUG_MATERIAL_FAIL:
                return L10nHelper::_("Adding drug/material failed");
            case EwhErrorCode::IMP_DRUG_MATERIAL_NOT_EXIST:
                return L10nHelper::_("Drug/material not exist");
            case EwhErrorCode::IMP_IMTICKET_NOT_FOUND:
                return L10nHelper::_("Could not found this import ticket");
            case EwhErrorCode::IMP_DRUG_MATERIAL_WRONG_TYPE:
                return L10nHelper::_("Drug/Material could not add to this import ticket because it's wrong type");
            case EwhErrorCode::EXP_CREAT_EXTICKET_FAIL:
                return L10nHelper::_("Creating export ticket failed");
            case EwhErrorCode::EXP_EXTICKET_NOT_EXIST:
                return L10nHelper::_("Export ticket not exist");
            case EwhErrorCode::EXP_REJECT_EXTICKET_FAIL:
                return L10nHelper::_("Rejecting Export ticket fail");
            case EwhErrorCode::EVP_COULT_NOT_FINALIZE_IMTICKET:
                return L10nHelper::_("Could not finalize for this import ticket. An import ticket could be finalized after all it's items valuated and allow to sell.");
            default:
                ;
                break;
        }
        	
    }
}
?>